package com.center.adapter;

import androidx.annotation.Nullable;

import com.center.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class FunctionsAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public FunctionsAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {

        helper.setText(R.id.tv_title, item);


        if (helper.getAdapterPosition() == 0) {
            helper.setImageResource(R.id.iv_pig, R.mipmap.share);
        } else if (helper.getAdapterPosition() == 1) {
            helper.setImageResource(R.id.iv_pig, R.mipmap.qq);
        } else if (helper.getAdapterPosition() == 2) {
            helper.setImageResource(R.id.iv_pig, R.mipmap.pub);
        } else if (helper.getAdapterPosition() == 3) {
            helper.setImageResource(R.id.iv_pig, R.mipmap.system);
        }

    }
}
